<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:t="http://myfaces.apache.org/tomahawk"
  xmlns:ui="http://java.sun.com/jsf/facelets">
  
  <ui:composition template="/WEB-INF/layout/admin/adminTemplate.xhtml">
    <ui:define name="subheader">View Art Products</ui:define>
  
    <ui:define name="adminBody">
      <h:form>
        <h:dataTable value="#{viewArtProductsBean.artProducts}" var="artProduct" style="width: 500px;">
          <h:column>
            <f:facet name="header">Filename</f:facet>
            #{artProduct.filename}
          </h:column>
          <h:column>
            <f:facet name="header">Type</f:facet>
            #{artProduct.type}
          </h:column>
          <h:column>
            <h:commandLink styleClass="smallActionLink">view</h:commandLink>
          </h:column>
          <h:column>
            <h:commandLink styleClass="smallActionLink" action="#{deleteArtProductBean.deleteArtProduct(artProduct)}">delete</h:commandLink>
          </h:column>
        </h:dataTable>
      </h:form>
      
      <h:outputText value="Successfully uploaded #{addArtProductBean.artProduct.filename}." rendered="#{addArtProductBean.uploadResult == 'SUCCESS'}"/>
      <h:outputText value="Failed to uploaded file." rendered="#{addArtProductBean.uploadResult == 'FAILED'}"/>
    </ui:define>
  </ui:composition>
  
  <h:body>
  </h:body>
  
</html>